Skip to content

feat: Share runs via Python SDK#667

Open
dima-aignostics wants to merge 40 commits into
mainfrom
feat/PYSDK-132-add-run-sharing-to-python-sdk
Open

feat: Share runs via Python SDK#667
dima-aignostics wants to merge 40 commits into
mainfrom
feat/PYSDK-132-add-run-sharing-to-python-sdk

Conversation

@dima-aignostics

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 4, 2026 11:10
@dima-aignostics dima-aignostics requested a review from a team as a code owner June 4, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to add “run sharing” capabilities to the Python SDK by introducing access-control resource wrappers (grants + share tokens), wiring them into the platform client, and exposing sharing workflows through the application service and CLI.

Changes:

  • Added new access-control resource layer (AccessGrant, ShareToken, ShareTokens) and new Run helpers (list_share_grants, grant_access).
  • Added new application service + CLI commands under run share ... to list/grant/revoke access and manage share tokens.
  • Regenerated codegen artifacts/docs for updated API parameters (e.g., grants relation filter, additional run filters, run organization_id field).

Reviewed changes

Copilot reviewed 8 out of 61 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/aignostics/platform/resources/access.py New access-control resource models and share-token listing/creation logic.
src/aignostics/platform/resources/runs.py Adds run-level grant listing/creation helpers with caching/retry integration.
src/aignostics/platform/_client.py Exposes a share_tokens resource on Client.
src/aignostics/application/_service.py Adds service methods for run sharing and token management.
src/aignostics/application/_cli.py Adds run share ... CLI command group.
tests/aignostics/platform/resources/access_test.py Unit tests for access resources.
tests/aignostics/platform/resources/run_sharing_test.py Unit tests for run-sharing workflows (currently mismatched with implementation).
codegen/in/openapi.json + codegen/out/** Codegen updates reflecting API spec changes.

Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/platform/resources/access.py Outdated
Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/platform/resources/runs.py Outdated
Comment thread src/aignostics/platform/_client.py Outdated
Comment thread src/aignostics/platform/resources/access.py Outdated
Comment thread tests/aignostics/platform/resources/run_sharing_test.py
Comment thread tests/aignostics/platform/resources/access_test.py Outdated
Comment thread src/aignostics/platform/resources/runs.py
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.21549% with 35 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/aignostics/application/_service.py 74.11% 22 Missing ⚠️
src/aignostics/platform/resources/access.py 82.81% 11 Missing ⚠️
src/aignostics/application/_cli.py 98.48% 1 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/aignostics/platform/_client.py 93.18% <100.00%> (+0.15%) ⬆️
src/aignostics/platform/resources/runs.py 85.41% <100.00%> (+0.74%) ⬆️
src/aignostics/application/_cli.py 77.79% <98.48%> (+2.24%) ⬆️
src/aignostics/platform/resources/access.py 82.81% <82.81%> (ø)
src/aignostics/application/_service.py 63.21% <74.11%> (-1.79%) ⬇️

... and 4 files with indirect coverage changes

Copilot AI review requested due to automatic review settings June 4, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 61 changed files in this pull request and generated 20 comments.

Comment thread src/aignostics/platform/resources/access.py Outdated
Comment thread src/aignostics/platform/resources/access.py Outdated
Comment thread src/aignostics/platform/resources/runs.py Outdated
Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/platform/resources/runs.py Outdated
Comment thread src/aignostics/application/_cli.py
Comment thread tests/aignostics/platform/resources/access_test.py Outdated
Comment thread tests/aignostics/platform/resources/access_test.py Outdated
Comment thread tests/aignostics/platform/resources/access_test.py Outdated
Comment thread tests/aignostics/platform/resources/access_test.py Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 18:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 61 changed files in this pull request and generated 9 comments.

Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/platform/resources/runs.py Outdated
Comment thread src/aignostics/platform/resources/runs.py Outdated
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_service.py Outdated
Comment thread src/aignostics/application/_cli.py Outdated
Comment thread src/aignostics/platform/resources/access.py
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch from 3bbec8d to 1131c91 Compare June 4, 2026 18:53
Copilot AI review requested due to automatic review settings June 4, 2026 18:55
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch from 1131c91 to fa0f3b9 Compare June 4, 2026 18:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 63 changed files in this pull request and generated 7 comments.

Comment thread src/aignostics/platform/resources/access.py Outdated
Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/application/_service.py Outdated
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_service.py Outdated
Comment thread src/aignostics/application/_cli.py
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch from fa0f3b9 to c4e64be Compare June 4, 2026 19:26
Copilot AI review requested due to automatic review settings June 5, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 64 changed files in this pull request and generated 4 comments.

Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/application/_cli.py
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_cli.py Outdated
Copilot AI review requested due to automatic review settings June 8, 2026 08:01
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch from ffa17dc to ece8b91 Compare June 8, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 66 changed files in this pull request and generated 4 comments.

Comment thread src/aignostics/application/_cli.py
Comment thread src/aignostics/application/_cli.py Outdated
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_service.py Outdated
Copilot AI review requested due to automatic review settings June 8, 2026 08:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 66 changed files in this pull request and generated 4 comments.

Comment thread src/aignostics/application/_cli.py
Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/application/_service.py Outdated
Copilot AI review requested due to automatic review settings June 8, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 66 changed files in this pull request and generated 1 comment.

Comment thread src/aignostics/application/_cli.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch from 64cd279 to 6ea4f1f Compare June 9, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 71 changed files in this pull request and generated 3 comments.

Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/application/_service.py Outdated
Comment thread src/aignostics/application/_service.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 70 changed files in this pull request and generated 6 comments.

Comment thread src/aignostics/platform/resources/runs.py
Comment thread src/aignostics/application/_service.py Outdated
Comment thread src/aignostics/platform/resources/access.py
Comment thread requirements/SWR-APPLICATION-4-2.md Outdated
Comment thread requirements/SWR-APPLICATION-4-1.md Outdated
Comment thread requirements/SHR-APPLICATION-4.md
dima-aignostics and others added 2 commits June 9, 2026 23:24
…-based filtering

The service now cross-filters share tokens against active grants instead of
relying on ShareTokens.list(run_id=...). Update the unit test to wire up the
mock client (was missing mock_get_client.return_value), configure a matching
grant on the mock run, and assert that list_share_grants is called with the
correct arguments.

Also restore run_dont_commit.py to pyrightconfig.json ignore list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 9, 2026 21:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 70 changed files in this pull request and generated 4 comments.

Comment thread src/aignostics/platform/resources/access.py
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_service.py
Comment thread src/aignostics/application/_service.py
@arne-aignx

Copy link
Copy Markdown
Collaborator

In addition to the SPECs outlined in the CR, we should also update the CLI Interface section in specifications/SPEC-APPLICATION-SERVICE.md with a short summary of the new commands

Comment thread src/aignostics/application/_cli.py
Comment thread tests/constants_test.py Outdated
Comment thread tests/constants_test.py Outdated
Comment thread requirements/SWR-APPLICATION-4-1.md Outdated
Comment thread requirements/SWR-APPLICATION-4-2.md Outdated
Comment thread src/aignostics/platform/resources/runs.py
dima-aignostics and others added 5 commits June 11, 2026 14:31
…4-2 to high-level statements

Replace API-implementation-detail wording with concise, high-level requirement
statements per review feedback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SonarCloud was reporting 0% coverage because it ran in parallel with
the test job and had no coverage.xml available. It also lacked the
sonar.python.coverage.reportPaths property to find the report.

- Add `test` to sonarcloud job's `needs` so it runs after tests finish
- Download test-results-ubuntu-latest artifact before the scan
- Add sonar.python.coverage.reportPaths=reports/coverage.xml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If tests fail before coverage.xml is generated, the artifact won't
exist and the download would error out the sonarcloud job. Using
continue-on-error lets SonarCloud still run (without coverage data)
rather than failing entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch 6 times, most recently from 2a76587 to 6ae872e Compare June 23, 2026 14:41
@dima-aignostics dima-aignostics force-pushed the feat/PYSDK-132-add-run-sharing-to-python-sdk branch from 6ae872e to 0bc4980 Compare June 23, 2026 21:15
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants